<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC 	"-//W3C//DTD XHTML 1.0 Transitional//EN"
						"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 	xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core">
	<f:view locale="#{facesContext.externalContext.request.locale}">
	<f:loadBundle basename="texte.Info" var="vhtexte" />
	<f:event type="javax.faces.event.PreRenderComponentEvent" listener="#{TourneyInfo.preInit}" />
	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<link rel="stylesheet" type="text/css" href="#{resource['css:dokument.css']}" />
		<title><h:outputText value="#{vhtexte.tourneyInfoTitel}"/></title>
	</h:head>
	<h:body>
		
		<h:outputStylesheet name="fonts.css"/>
		<p>
		<!-- Navigation -->
		<h:outputText value="Navigation" styleClass='headline' /><br />
		<b><h:outputLink value="tourneys.xhtml"><h:outputText value="[>> #{vhtexte.turniereTitel}"/></h:outputLink> | 
		<h:outputText value="[>> #{vhtexte.tourneyInfoTitel}"/> | 
		<h:outputLink value="playerList.xhtml"><f:param name="tourneyID" value="#{TourneyInfo.tourneyInfo.ID}" /><h:outputText value="[>> #{vhtexte.playerList}"/></h:outputLink>
		<h:outputText value=" | " rendered="#{TourneyInfo.tourneyInfo.gridAvailable}"/>
		<h:outputLink value="bracket.xhtml" rendered="#{TourneyInfo.tourneyInfo.gridAvailable}">
				<f:param name="tourneyID" value="#{TourneyInfo.tourneyInfo.ID}" />
				<h:outputText value="[>> #{vhtexte.bracket}"/>
			</h:outputLink> | 
		<h:outputLink value="login.xhtml"><f:param name="action" value="logout" /><h:outputText value="[>> #{vhtexte.logout}"/></h:outputLink>
		
		</b>
		<br /><br />
		
		
		<h:outputText value="#{vhtexte.tournyInfo}" styleClass='headline' />
		<!-- Die Turnierinfo anzeigen -->
		<h:panelGrid columns="2" border="0" cellpadding="2" rendered="#{TourneyInfo.tourneyInfo != null}">
			
			<h:panelGroup>
				<b><h:outputText value="Name:" styleClass='legal'/></b>
			</h:panelGroup>	
			<h:outputText value="#{TourneyInfo.tourneyInfo.name}" />
			
			<h:panelGroup>
				<b><h:outputText value="#{vhtexte.game}:" styleClass='legal'/></b>
			</h:panelGroup>	
			<h:outputText value="#{TourneyInfo.tourneyInfo.game}" />
			
			<h:panelGroup>
				<b><h:outputText value="#{vhtexte.maxPlayers}:" styleClass='legal'/></b>
			</h:panelGroup>	
			<h:outputText value="#{TourneyInfo.tourneyInfo.maxPlayers}" />
			
			<h:panelGroup>
				<b><h:outputText value="#{vhtexte.regPlayers}:" styleClass='legal'/></b>
			</h:panelGroup>	
			<h:panelGroup>
				<h:outputText value="#{TourneyInfo.tourneyInfo.registeredPlayers}" />
				(<h:outputLink
					 value="playerList.xhtml">
					  <f:param name="tourneyID" value="#{TourneyInfo.tourneyInfo.ID}" />
					  <h:outputText value="#{vhtexte.playerList}" styleClass='legal' />
				</h:outputLink>)
			</h:panelGroup>
			
			<h:panelGroup>
				<b><h:outputText value="#{vhtexte.signedPlayers}:" styleClass='legal'/></b>
			</h:panelGroup>	
			<h:panelGroup>
				<h:outputText value="#{TourneyInfo.tourneyInfo.signedInPlayers}" />
				(<h:outputText value="#{vhtexte.infoSignedIn}" />)
			</h:panelGroup>
			
			<h:panelGroup>
				<b><h:outputText value="#{vhtexte.start}:" styleClass='legal'/></b>
			</h:panelGroup>
			<h:outputText value="#{TourneyInfo.tourneyInfo.start}" />
			
			<h:panelGroup>
				<b><h:outputText value="#{vhtexte.signedUp}:" styleClass='legal'/></b>
			</h:panelGroup>	
			<h:panelGroup>
				<h:outputText value="#{TourneyInfo.signedUp ? vhtexte.yes : vhtexte.no}" style="color: #{TourneyInfo.signedUp ? 'green' : 'red'}"/>
			</h:panelGroup>
			
			<h:panelGroup>
				<b><h:outputText value="#{vhtexte.signedIn}:" styleClass='legal'/></b>
			</h:panelGroup>	
			<h:panelGroup>
				<h:outputText value="#{TourneyInfo.signedIn ? vhtexte.yes : vhtexte.no}" style="color: #{TourneyInfo.signedIn ? 'green' : 'red'}"/>
			</h:panelGroup>
			
			<h:panelGroup>
				<b><h:outputText value="Status:" styleClass='legal'/></b>
			</h:panelGroup>	
			<h:panelGroup>
				<h:outputText value="#{TourneyInfo.tourneyInfo.status == 'SIGNUP' ? vhtexte.statusSignUp : TourneyInfo.tourneyInfo.status == 'SIGNIN' ? vhtexte.statusSignIn : TourneyInfo.tourneyInfo.status == 'RUNNING' ? vhtexte.statusRunning : vhtexte.statusFinished}" style='color: #{TourneyInfo.tourneyInfo.statusColor}' />
			</h:panelGroup>
		</h:panelGrid><br />
		<!-- Falls keine Turnierdaten vorhanden sind, Fehler anzeigen -->
		<h:outputText value="#{vhtexte.noTourneyInfo}" rendered="#{TourneyInfo.tourneyInfo == null}" styleClass="error" />
		<p>
		<h:outputText value="#{vhtexte.tourneySignUp}" rendered="#{TourneyInfo.tourneyInfo != null}" styleClass='subhead' />
		<br />
		<!-- Turnieranmeldung -->
		<!-- Register -->
		<h:panelGroup rendered="#{TourneyInfo.tourneyInfo != null}">
			- <h:outputLink value="tourney_info.xhtml" rendered="#{!TourneyInfo.signedUp and (TourneyInfo.tourneyInfo.status == 'SIGNUP' or TourneyInfo.tourneyInfo.status == 'SIGNIN')}">
				<f:param name="action" value="signUp" />
				<f:param name="tourneyID" value="#{TourneyInfo.tourneyInfo.ID}" />
				<h:outputText value="#{vhtexte.signUp}"/>
			</h:outputLink>
			<h:outputText value="#{vhtexte.signUp}" rendered="#{TourneyInfo.signedUp or TourneyInfo.tourneyInfo.status != 'SIGNUP' and TourneyInfo.tourneyInfo.status != 'SIGNIN'}"/>
		<br />
		</h:panelGroup>
		
		<!-- Unregister -->
		<h:panelGroup rendered="#{TourneyInfo.tourneyInfo != null}">
			- <h:outputLink value="tourney_info.xhtml" rendered="#{TourneyInfo.signedUp and TourneyInfo.tourneyInfo.status != 'RUNNING' and TourneyInfo.tourneyInfo.status != 'FINISHED'}">
				<f:param name="action" value="signDown" />
				<f:param name="tourneyID" value="#{TourneyInfo.tourneyInfo.ID}" />
				<h:outputText value="#{vhtexte.withdraw}"/>
			</h:outputLink>
			<h:outputText value="#{vhtexte.withdraw}" rendered="#{TourneyInfo.tourneyInfo.status != 'SIGNUP' and TourneyInfo.tourneyInfo.status != 'SIGNIN' or !TourneyInfo.signedUp}"/>
		<br />
		</h:panelGroup>
		
		<!-- Anmelden -->
		<h:panelGroup rendered="#{TourneyInfo.tourneyInfo != null}">
			- <h:outputLink value="tourney_info.xhtml" rendered="#{!TourneyInfo.signedIn and TourneyInfo.tourneyInfo.status == 'SIGNIN' and TourneyInfo.signedUp and (TourneyInfo.tourneyInfo.signedInPlayers lt TourneyInfo.tourneyInfo.maxPlayers)}">
				<f:param name="action" value="signIn" />
				<f:param name="tourneyID" value="#{TourneyInfo.tourneyInfo.ID}" />
				<h:outputText value="#{vhtexte.signIn}"/>
			</h:outputLink>
			<h:outputText value="#{vhtexte.signIn}" rendered="#{TourneyInfo.tourneyInfo.status != 'SIGNIN' or TourneyInfo.signedIn or !TourneyInfo.signedIn and !TourneyInfo.signedUp or TourneyInfo.tourneyInfo.signedInPlayers ge TourneyInfo.tourneyInfo.maxPlayers}"/> 
			(<b>
			<h:outputText value="#{vhtexte.signInInfo}" rendered="#{TourneyInfo.tourneyInfo.signedInPlayers lt TourneyInfo.tourneyInfo.maxPlayers}" styleClass='legal'/>
			<h:outputText value="#{vhtexte.maxPlayersReached}" rendered="#{TourneyInfo.tourneyInfo.signedInPlayers ge TourneyInfo.tourneyInfo.maxPlayers}" styleClass='legal' style="color: red" />
			</b>)
		<br />
		</h:panelGroup>
		
		<!-- Abmelden -->
		<h:panelGroup rendered="#{TourneyInfo.tourneyInfo != null}">
			- <h:outputLink value="tourney_info.xhtml" rendered="#{TourneyInfo.signedIn and TourneyInfo.tourneyInfo.status != 'RUNNING' and TourneyInfo.tourneyInfo.status != 'FINISHED'}">
				<f:param name="action" value="signOut" />
				<f:param name="tourneyID" value="#{TourneyInfo.tourneyInfo.ID}" />
				<h:outputText value="#{vhtexte.signOut}"/>
			</h:outputLink>
			<h:outputText value="#{vhtexte.signOut}" rendered="#{TourneyInfo.tourneyInfo.status != 'SIGNIN' or !TourneyInfo.signedIn}"/>
		<br />
		</h:panelGroup>
		
		<!-- Turnierbaum anzeigen -->
		<h:panelGroup rendered="#{TourneyInfo.tourneyInfo != null}">
			- <h:outputLink value="bracket.xhtml" rendered="#{TourneyInfo.tourneyInfo.gridAvailable}">
				<f:param name="tourneyID" value="#{TourneyInfo.tourneyInfo.ID}" />
				<h:outputText value="#{vhtexte.bracket}"/>
			</h:outputLink>
			<h:outputText value="#{vhtexte.bracket}" rendered="#{!TourneyInfo.tourneyInfo.gridAvailable}"/>
		<br />
		</h:panelGroup>
		
		<br />
		
		<!-- Meine Turnieranmeldung -->
		<h:outputText value="#{vhtexte.tourneyMyParticipation}" rendered="#{TourneyInfo.tourneyInfo != null}" styleClass='subhead' />
		<br />
		<b><h:outputText value="#{vhtexte.turnierBeendet}" styleClass='legal' rendered="#{TourneyInfo.tourneyInfo.status == 'FINISHED'}" /></b>
		<h:panelGroup rendered="#{TourneyInfo.tourneyInfo.status != 'FINISHED'}">			
			<br />
			
			<!-- Mein Gegner -->
			<h:panelGroup rendered="#{TourneyInfo != null}">
				<b><h:outputText value="#{vhtexte.currentOpponent}: " styleClass='legal'/></b>
				<h:outputText rendered="#{TourneyInfo.nextRoundOccupied}" value="#{TourneyInfo.nextRoundOccupied ? vhtexte.dropOut : TourneyInfo.nextOpponent}" style="color: #{TourneyInfo.nextRoundOccupied ? 'red' : 'green'}" />
				<h:outputText rendered="#{!TourneyInfo.opponentExists and !TourneyInfo.dropedOut and TourneyInfo.tourneyInfo.status == 'RUNNING'}" value="#{TourneyInfo.opponentExists ? TourneyInfo.nextOpponent : vhtexte.noOpponent}" style="color: #{TourneyInfo.opponentExists ? 'green' : 'red'}"/>
				<h:outputText rendered="#{TourneyInfo.tourneyInfo.status != 'RUNNING' and TourneyInfo.tourneyInfo.status != 'FINISHED'}" value="#{vhtexte.tournamentNotStarted}"/>
			</h:panelGroup>
			<br />
			<!-- Niederlage melden -->
			<h:panelGroup rendered="#{TourneyInfo != null}">
				- <b><h:outputLink value="tourney_reportLoss.xhtml" rendered="#{TourneyInfo.signedUp and TourneyInfo.tourneyInfo.status == 'RUNNING' and TourneyInfo.tourneyInfo.status != 'FINISHED' and !TourneyInfo.nextRoundOccupied and TourneyInfo.opponentExists}">
					<f:param name="tourneyID" value="#{TourneyInfo.tourneyInfo.ID}" />
					<h:outputText value="#{vhtexte.reportLoss}"/>
				</h:outputLink></b>
				<h:outputText value="#{vhtexte.reportLoss}" rendered="#{TourneyInfo.tourneyInfo.status != 'RUNNING' or !TourneyInfo.signedUp or TourneyInfo.nextRoundOccupied or !TourneyInfo.opponentExists}"/>
			</h:panelGroup>
		<br />
		</h:panelGroup>
		
		
		<br />
		<!-- Zurueck zur Uebersicht -->
		- <h:outputLink value="tourneys.xhtml">
			<h:outputText value="#{vhtexte.backToOverview}"/>
		</h:outputLink>






		</p>
		</p>

		
	</h:body>
	</f:view>
</html>
